<template>
<el-container>
  <el-main>
    <el-table
      :data="limit.list"
      style="width: 100%"
    >
      <el-table-column
        prop="id"
        label="ID">
      </el-table-column>

      <el-table-column label="报销限额">
        <template slot-scope="scope">
          <el-input v-model="scope.row.limit_money" placeholder="输入报销金额"></el-input>
        </template>
      </el-table-column>

      <el-table-column
        prop="created_at"
        label="创建时间">
      </el-table-column>

      <el-table-column
        prop="updated_at"
        label="更新时间">
      </el-table-column>


      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button
            size="mini"
            @click="handleEdit(scope.row)">
            编辑
          </el-button>

        </template>
      </el-table-column>


    </el-table>
  </el-main>
</el-container>
</template>

<script>
  import {mapState,mapActions} from "vuex"
  import {editLimit} from '@/apilist/SystemSetting'
export default {
  name: "setLimit",
  computed: {
      ...mapState("Setdata",["limit"]),
  },
    methods:{
        ...mapActions("Setdata",[
            "getLimitAction"
        ]),
        handleEdit(row){
            editLimit({id: row.id,limit_money: row.limit_money}).then(res => {
                this.$message({
                    type:'success',
                    message: res.msg,
                    onClose: ()=>{
                        this.getLimitAction()
                    }
                })
            })
        }
    },
}
</script>

<style scoped>

</style>
